package com.elrichuang.userserver.enums;

import java.util.Objects;

/**
 * 求职者状态枚举类
 * 0未面试
 * 100面试通过
 * 110面试不通过
 * 120复试
 * 200待培训
 * 210正在培训
 * 220劝退
 * 230自离
 * 240培训通过
 * 300待跟单
 * 310跟单通过
 * 320跟单不通过
 * 400待入职
 * 410入职成功
 * 420入职失败
 * @author elric
 * @date 2022-03-01
 */
public enum StatusLogPhaseEnum {

	PHASE_UNKNOWN("unknown","未知状态"),

	/**
	 * 面试
	 */
	PHASE_INTERVIEW("interview", "面试"),

	/**
	 * 培训
	 */
	PHASE_TRAINING("training", "培训"),

	/**
	 * 跟单
	 */
	PHASE_ORDER("order", "跟单"),

	/**
	 * 入职
	 */
	PHASE_ENTRY("entry", "入职");

	private final String code;
	private final String info;

	StatusLogPhaseEnum(String code, String info) {
		this.code = code;
		this.info = info;
	}

	public String getCode() {
		return code;
	}

	public String getInfo() {
		return info;
	}

	public static StatusLogPhaseEnum fromCode(String code) {
		for (StatusLogPhaseEnum type : StatusLogPhaseEnum.values()) {
			if (Objects.equals(type.getCode(), code)) {
				return type;
			}
		}
		return StatusLogPhaseEnum.PHASE_UNKNOWN;
	}
}
